package com.lsmo.android.carfans.view.forum;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lsmo.android.carfans.R;
import com.lsmo.android.carfans.model.forum.ForumThread;

public class ForunThreadListItemLayout extends LinearLayout {
 
	private TextView mTopicText ;
	private TextView mPublicDateText;
	private TextView mAuthorText;
	private ImageView mImageView;
	
	public ForunThreadListItemLayout(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		((LayoutInflater)context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE))
		.inflate(R.layout.forum_list_item_layout, this);
		
		
		this.mImageView = (ImageView)this.findViewById(R.id.forum_list_item_img);
		this.mTopicText = (TextView)this.findViewById(R.id.forum_list_item_topic_text);
		this.mPublicDateText= (TextView)this.findViewById(R.id.forum_list_item_publicDate_text);
		this.mAuthorText = (TextView)this.findViewById(R.id.forum_list_item_author_text);
		mImageView.setBackgroundResource(R.drawable.forum_thread_icon);
	}
	
	public void updateView(ForumThread ft){
	    
		this.mTopicText.setText(ft.getTitle());
		this.mPublicDateText.setText(ft.getPublishDate());
		this.mAuthorText.setText(ft.getAuthor());
	}

	
	
}
